/* 

==========================================================

DX490a - Summer 2010

Instructor: Stelios Manousakis

==========================================================

Class 2.4:

Interfacing 2: Multitouch trackpad

Contents:

• MultiTouchPad (MacBook/MacBookPro only)

• Lab exercise

==========================================================

*/



// ================= MULTITOUCHPAD =================


// Now, let's try our hands at a quite involved installation procedure of a very fun Quark: MultiTouchPad is a class created by Batuhan Bozkurt that acts as a wrapper of the tongsengmod application inside SuperCollider, allowing you to get multitouch data from your MacBook's touchpad! This will only work on newer MacBook family computers, and according to the developer it has been tested only on Leopard only so far. If your MacBook doesn't support 3-finger gestures, it is not multitouch-enabled, so this unfortunately won't work. Have a look at this thread to find out more on that:

"open http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/New-Quark-MultiTouchPad-td3967869.html#a3968135".unixCmd


// The protocol used behind the scenes by tongsengmod is TUIO (a protocol specifically designed for table-top tangible user interfaces). 

// More info here:

"open http://tuio.lfsaw.de/index.shtml".unixCmd;

"open http://www.tuio.org/?specification".unixCmd;


// There are a few steps involved to get this going. 

// You can do 1a. (easy 2-step install) OR 1b. (3-step process) to install the tongsengmod application to your machine.

// Then do 2. to get the MultiTouchPad quark.


/* 1a.======

Download and install a pre-compiled version of tongsengmod:

==========

*/

// A: download the precompiled tongsengmod binary

"open http://github.com/downloads/batuhan/tongsengmod/tongsengmod.zip".unixCmd


// B:

//* Open Terminal application:

"open /Applications/Utilities/Terminal.app".unixCmd

/* Then, write the following inside Terminal (without the $ symbol, this just means it's a new command, after the previous one has come through):

$ cd <drag-drop the tongsengmod binary here and this will give you the path>

$ sudo mv <same path as above>

$ enter your password

// Now the application is installed, and SC should be able to access it - provided your computer is multitouch capable. Now go to 2.

*/


// OR:

/* 1b. ======

Downloading and compiling tongsengmod (From the MultiTouchPad helpfile):

==========

*/

/* A: 

Make sure you have Apple Developer Tools installed.

*/


/* B:

Download tongsengmod source from: http://github.com/batuhan/tongsengmod (or download via git://github.com/batuhan/tongsengmod.git ).

"open http://github.com/batuhan/tongsengmod/zipball/0.4".unixCmd 

// you could also have a look here and see if there is a newer version

"open http://github.com/batuhan/tongsengmod/downloads".unixCmd

*/

/* C:

Extract the source archive (for example, to the desktop; if you put it elsewhere, you 'll need to replace cd ~/Desktop with the folder and path where you downloaded tongsengmod).

*/

// Open Terminal application:

"open /Applications/Utilities/Terminal.app".unixCmd

/* Then, write the following inside Terminal (without the $ symbol, this just means it's a new command, after the previous one has come through)

$ cd ~/Desktop 

$ cd <extracted folder name>

$ make

$ sudo make install

*/




/* 2.  ======

• Download the MultiTouchPad Quark:

==========

*/

Quarks.install( "MultiTouchPad", checkoutIfNeeded: false)


//• Open up the helpfile, and enjoy!

MultiTouchPad



/*

// ================= LAB EXERCISE =================

>>>> Lab exercise / homework:

Make an instrument incorporating multitouch 

*/